package com.shujia.wyh.day26;

public class GetThread implements Runnable {
    private Student student;
//    private Object obj = new Object();

    GetThread(Student student) {
        this.student = student;
    }

    @Override
    public void run() {
//        Student student = new Student();
        while (true){
            synchronized (student){
                System.out.println(student.name + "---" + student.age);
            }

        }
    }
}
